<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box {
            width: 20px;
            height: 20px;
            background: red;
        }
    </style>
</head>

<body>
    <!-- <input id="range" type="range" value="5" onchange="changeV()"> -->
    <input type="range" id="range" value="20" min="0" max="200" step="1" onchange="changeV()">
    <div class="box"></div>
    <script>
        const range = document.getElementById('range');

        function changeV() {
            const boxL = parseInt(range.value);
            console.log(boxL);
            const box = document.getElementsByClassName('box')[0];
            box.style.width = boxL + 'px';
            box.style.height = boxL + 'px';
        }
    </script>
</body>

</html>